import {$,$$} from "../modules/public.js"
import indextou from "../modules/indextou.js"

indextou()

  //搜索图切换
  $(".img1").onmouseenter=function(){
    this.src="./imags/search1.png"
  }
  $(".img1").onmouseout=function(){
    this.src="./imags/search2.png"
  }
  $(".img2").onmouseenter=function(){
    this.src="./imags/search1.png"
  }
  $(".img2").onmouseout=function(){
    this.src="./imags/search2.png"
  }
  $(".img3").onmouseenter=function(){
    this.src="./imags/del2.png"
  }
  $(".img3").onmouseout=function(){
    this.src="./imags/del1.png"
  }
  $(".img1").onclick=function(){
    $(".c1").style.display="none"
    $(".c2").style.display="flex"
  }
  $(".img3").onclick=function(){
    $(".c1").style.display="flex"
    $(".c2").style.display="none"
  }

  //轮播图
function a(){
  let index=0;
  let i=1;
  // $(".carousel-indicators").onmouseenter
  setInterval(() => {
    if(i>$$(".carousel-item").length-1){
      i=0;
    }
    $$(".carousel-indicators button")[index].className="";
    $$(".carousel-item")[index].className="carousel-item";
    $$(".carousel-indicators button")[i].className="active";
    $$(".carousel-item")[i].className="carousel-item active";
    index=i;
    i++;
  }, 3000);
}
a()



